﻿using Ndns.ServerHost.Abstractions;
using Ndns.ServerHost.Abstractions.Services;
using System.Threading.Tasks;

namespace Ndns.ServerHost
{
    class FallbackMiddleware : IMiddleware
    {
        public void Dispose()
        {
            // nop
        }

        public Task InvokeAsync(DnsContext context)
        {
            context.Response.IgnoreRequest = true;
            return Task.CompletedTask;
        }

        public static Task StaticInvokeAsync(DnsContext context)
        {
            context.Response.IgnoreRequest = true;
            return Task.CompletedTask;
        }

        public void RegisterServices(IServiceCollection services, RequestDelegate next)
        {
            // nop
        }

        public void Start()
        {
            // nop
        }
    }
}
